package com.buaa.aimall.goodsModule.Service;

import com.buaa.aimall.Utils.PageReturnResult;
import com.buaa.aimall.goodsModule.Entity.GoodsOrderEntity;
import com.buaa.aimall.goodsModule.DTO.FilterOrderDTO;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.buaa.aimall.goodsModule.DTO.CreateOrderDTO;
import com.buaa.aimall.goodsModule.DTO.UserOrderStatsDTO;
import com.buaa.aimall.goodsModule.Entity.TransactionOrderEntity;

import java.util.List;

public interface GoodsOrderService extends MPJDeepService<GoodsOrderEntity> {

    List<GoodsOrderEntity> getModelOrderListByModelId(String modelId);

    PageReturnResult<GoodsOrderEntity> filterOrder(FilterOrderDTO filterModelOrderDTO);

    UserOrderStatsDTO getUserOrderStats(Integer orderType, String userId);

    TransactionOrderEntity createOrders(List<CreateOrderDTO> createOrderDTOs, String modelCouponId, String computeCouponId);

    Boolean payTransaction(String transactionId, Boolean isSuccess);

    TransactionOrderEntity createOrdersFromCart(List<String> cartItemIds, String modelCouponId, String computeCouponId);

    Integer calculateCartItemsAmount(List<String> cartItemIds, String modelCouponId, String computeCouponId);

    Integer calculateOrdersAmount(List<CreateOrderDTO> createOrderDTOs, String modelCouponId, String computeCouponId);

}
